/********************************Copyright (c)**********************************\
**
**                   (c) Copyright 2021, Main, China, QD.
**                           All Rights Reserved
**
**                                By(wo4fisher)
**                           http://www.wo4fisher.com
**
**----------------------------------文件信息------------------------------------
** 文件名称: BSP_GU12864.h
** 创建人员: wht
** 创建日期: 2021-08-06
** 文档描述:
**
**----------------------------------版本信息------------------------------------
** 版本代号: V0.1
** 版本说明: 初始版本
**
**------------------------------------------------------------------------------
\********************************End of Head************************************/

#ifndef __GU12864_H_
#define __GU12864_H_

#include "common.h"
#include "STC8Axx.h"
#include "bsp_tick.h"
#include "bsp_delay.h"
#include "zf_pca_delay.h"
#include "intrins.h"
#include "stdio.h"
#include "bsp_codetab.h"

/*************  DISPLAY MODE SET ***************/
#define   GUNOMALCOLORMODE    1  //正常颜色模式
#define   GUINVERTCOLORMODE   0  // 反色模式

/*****************  MOVE SET ********************/
#define   GU_Y_MOVE_UP        0X08
#define   GU_Y_MOVE_DOWN      0X00
#define   GU_Y_MOVE_DOT1      0X04
#define   GU_Y_MOVE_DOT2      0X06
#define   GU_Y_MOVE_DOT8      0X02

/***************  DISPLAY SET ********************/
#define   GU_DISPLAY_ON      0X40
#define   GU_DISPLAY_OFF     0X00
#define   GU_DISPLAY_L1      0X08
#define   GU_DISPLAY_L0      0X04
#define   GU_DISPLAY_L0L1    0X0C

void GU_WriteData(uint8 data8);
void GU_WriteCmd(uint8 cmd);
void GU_ReadAddr(uint8 * x, uint8 * y);
void GU_Init(void);
void GU_DisplaySet(uint8 LSel, bit onOff);
void GU_SetLed(uint8 brightness);//0-15 越小越亮
void GU_SetDisArea(void); //主要用于初始化
void GU_SetPos(uint8 x, uint8 y); //x:0~127;y:0~15
void GU_SetAddrMode(void);

void GU_Y_MOVE(uint8 moveMode);
void GU_Set_X_StartAddr(uint8 addr);

void GU_Fill(uint8 bmp_dat);
void GU_Clear(void);
void GU_RecClear ( uint8 x0, y0, x1, y1);
void GU_PutStr6x8(uint8 x, y, uint8 ch[], bit mode);//值类型先转换为字符串,mode为显示模式，正常，反色
void GU_PutStr8x16(uint8 x, y, uint8 ch[], bit mode);
void GU_PutStr20x40(uint8 x, y, uint8 ch[], bit mode);
void GU_PutChinese(uint8 x, y, N, bit mode);
void GU_Draw_BMP(uint8 x0, y0, x1, y1, uint8 BMP[], bit mode);
#endif


/********************************End of File************************************/